﻿@model AP.Framework.Infrastructure.Entities.cms_Article
<script type="text/javascript">
    $(function () {
        $('#Content').xheditor({ upLinkUrl: "/Admin/Article/Upload",
            upLinkExt: "zip,rar,txt",
            upImgUrl: "/Admin/Article/Upload",
            upImgExt: "jpg,jpeg,gif,png"
        });
        $('#file_upload').uploadify({
            'swf': '@Url.Content("~/Content/themes/uploadify/uploadify.swf")',
            'buttonText': '添加图片...',
            'cancelImg': '@Url.Content("~/Content/themes/uploadify/uploadify-cancel.png")',
            'uploader': '/Admin/Article/Upload',
            'auto': true,
            'onUploadSuccess': function (file, data, response) {
                eval("data=" + data);
                $("#ImageUrl").val(data.msg);
                $("#articleImage").attr("src", data.msg);
            }
        });
        $("#articleImage").attr("src", $("#ImageUrl").val());
    });      
</script>
@Html.ValidationSummary(true)
<div class="control-group">
    <label class="control-label">
        频道</label>
    <div class="controls">
        @Html.DropDownListFor(model => model.ChannelID, (IEnumerable<SelectListItem>)ViewBag.channelList)
        @Html.ValidationMessageFor(model => model.ChannelID)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        分类</label>
    <div class="controls">
        @Html.DropDownListFor(model => model.CategoryId, (IEnumerable<SelectListItem>)ViewBag.articleCategoryList)
        @Html.ValidationMessageFor(model => model.CategoryId)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        显示方式</label>
    <div class="controls">
        @Html.RadioButtonFor(p => p.DisplayStyle, 1) 文本 @Html.RadioButtonFor(p => p.DisplayStyle, 2)幻灯片
        @Html.ValidationMessageFor(model => model.DisplayStyle)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        标题</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.Title, new { @placeholder = "标题", style = "width:98%;" })
        @Html.ValidationMessageFor(model => model.Title)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        作者</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.Author, new { @placeholder = "作者", style = "width:98%;" })
        @Html.ValidationMessageFor(model => model.Author)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        摘要</label>
    <div class="controls">
        @Html.TextAreaFor(model => model.ZhaiYao, new { @placeholder = "摘要", style = "width:98%" })
        @Html.ValidationMessageFor(model => model.ZhaiYao)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        正文</label>
    <div class="controls">
        @Html.TextAreaFor(model => model.Content, new { @placeholder = "描述", style = "width:100%; height:500px;" })
        @Html.ValidationMessageFor(model => model.Content)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        图片</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.ImageUrl, new { @placeholder = "点击上传图片按钮......" })
        &nbsp;&nbsp;(当选择显示方式为幻灯片时,必须上传一张<span style="color: Red">940*374</span>象素的图片)
        <input type="file" name="file_upload" id="file_upload" />
        <img id="articleImage" alt="图片缩放显示" src="" style="" />
        @Html.ValidationMessageFor(model => model.ImageUrl)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        排序号</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.Sequence, new { @placeholder = "排序号" })
        @Html.ValidationMessageFor(model => model.Sequence)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        是否隐藏/锁定</label>
    <div class="controls">
        <label class="checkbox">
            @Html.CheckBoxFor(model => model.IsDisable)
            @Html.ValidationMessageFor(model => model.IsDisable)
        </label>
    </div>
</div>
<div class="control-group">
    <div class="controls">
        <button type="submit" class="btn">
            保 存</button>
    </div>
</div>
